# $Id$
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Maintainer: Vesa Kaihlavirta <vesa@archlinux.org>
# Contributor: Roman Cheplyaka <roma@ro-che.info>

pkgname=libedit
_pkgver=20170329-3.1
pkgver=${_pkgver/-/_}
pkgrel=1
pkgdesc='Command line editor library providing generic line editing, history, and tokenization functions'
url='http://thrysoee.dk/editline/'
arch=('i686' 'x86_64')
license=('BSD')
depends=('ncurses')
source=("http://thrysoee.dk/editline/libedit-${_pkgver}.tar.gz")
sha256sums=('91f2d90fbd2a048ff6dad7131d9a39e690fd8a8fd982a353f1333dd4017dd4be')

build() {
	cd "${srcdir}/${pkgname}-${_pkgver}"
	./configure --prefix=/usr --enable-widec
	make
}

package() {
	cd "${srcdir}/${pkgname}-${_pkgver}"
	make prefix="${pkgdir}"/usr install

	rm "${pkgdir}"/usr/share/man/man3/history.3 # conflicts with readline
	cp "${pkgdir}"/usr/share/man/man3/editline.3 "${pkgdir}"/usr/share/man/man3/el.3
	install -Dm644 COPYING "${pkgdir}"/usr/share/licenses/libedit/LICENSE
}
